import txios from '../index'
import type { IDataType } from '../types'
import { musicApi } from './type'
// import type { userID } from './type'

export function getTopSong(type: number) {
  return txios.get<any>({
    url: musicApi.getTopSong,
    params: {
      type: type ?? 0
    }
  })
}

export function getTopList() {
  return txios.post<any>({
    url: musicApi.getTopList
  })
}

export function getNewMv() {
  return txios.post<any>({
    url: musicApi.getNewMv
  })
}

export function getMvInfo(mvId: number[]) {
  let pramIDS = '?ids=' + mvId.map((item) => `${item}`).join(',')
  return txios.get<any>({
    url: musicApi.getMvInfo + pramIDS
  })
}

export function getMvUrl(mvId: number) {
  let pramIDS = '?id=' + `${mvId}`
  return txios.get<any>({
    url: musicApi.getMvUrl + pramIDS
  })
}

export function getNewVideo() {
  return txios.post<any>({
    url: musicApi.getNewVideo
  })
}

export function getVideoInfo(mvId: number[]) {
  let pramIDS = '?ids=' + mvId.map((item) => `${item}`).join(',')
  return txios.get<any>({
    url: musicApi.getMvInfo + pramIDS
  })
}

export function getVideoUrl(mvId: number) {
  let pramIDS = '?id=' + `${mvId}`
  return txios.get<any>({
    url: musicApi.getVideoUrl + pramIDS
  })
}

export function getVideoType() {
  return txios.post<any>({
    url: musicApi.getVideoType
  })
}

export function getVideoTypeList(mvType: number) {
  let pramIDS = '?id=' + `${mvType}`
  return txios.get<any>({
    url: musicApi.getVideoTypeList + pramIDS
  })
}
